<!DOCTYPE HTML>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<meta charset="utf-8">
<head th:include="include :: header"></head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">


    <form class="form-horizontal m" id="form-user-template-msg">
        <input type="hidden" th:value="${openStrs}" name="openStrs"/>
        <div class="form-group">
            <label class="col-sm-2 control-label">模板列表</label>
            <div class="col-sm-10">
                <select id="selectTemplate" th:onchange="changeTemplate()" class="form-control m-b" >
                    <option th:data-content='请选择'>请选择</option>
                    <option
                            th:data-templateId="${t.template_id}"
                            th:data-content="${t.content}"
                            th:data-example="${t.example}"
                            th:each="t : ${templates}"
                            th:text="${t.title}">模板名称
                    </option>
                </select>
            </div>
        </div>


        <div class="hr-line-dashed"></div>
        <div class="form-group" id="contentDiv">
            <label class="col-sm-2 control-label">模板内容</label>

            <div class="col-sm-10">
                <p class="form-control-static" id="template-content"></p>
            </div>
        </div>


    </form>
</div>
<div th:include="include::footer"></div>
<script type="text/javascript">
    var prefix = ctx + "wx/user"
    $("#form-user-template-msg").validate({
        rules: {
            first: {
                required: true
            },
            keyword1:{
                required: true
            },
            keyword2:{
                required: true
            },
            keyword3:{
                required: true
            },
            keyword4:{
                required: true
            },
            remark:{
                required: true
            }

        },
        focusCleanup: true
    });

    function submitHandler() {
        if ($.validate.form()) {
            $.operate.save(prefix + "/toSendTemplateMsg", $('#form-user-template-msg').serialize());
        }
    }
</script>

</body>
</html>
